﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataModel;

namespace Web
{
    public partial class productDel : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                if (this.Request.QueryString["id"] != null)
                {
                    string id = this.Request.QueryString["id"];
                    daProduct da = new daProduct();
                    da.DeleteProduct(id);

                    Response.Buffer = true;
                    Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
                    Response.Expires = 0;
                    Response.CacheControl = "no-cache";

                    Response.Redirect("~/products.aspx");
                }
            }
        }
    }
}